<template>
  <div class="news-detail"> 新闻详情 {{ $route.params.id }}</div>
</template>

<script>
import {useRoute} from "vue-router";
import {watch} from "vue";

export default {
  name: "News",

  setup() {
    const route = useRoute()
    watch(() => route.params,
        (toParams, previousParams) => {
          console.log(toParams, previousParams)
        })
  }

}
</script>

<style scoped>
.news-detail {
  width: 200px;
  height: 200px;
  background: orange;
}
</style>